"""
@Time ： 2022/10/31 10:08
@Auth ： 陈杰 200320501042
@E-mail : 1612845322@qq.com
"""


class People:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def walk(self, speed):
        # 人类的走方法
        print("%d岁的%s正在以%d米没秒的速度行走" % (self.age, self.name, speed))

    # 学生类，继承自人类


class Student(People):
    # 学习方法
    def study(self, sub):
        print("%d岁的%s正在学习%s" % (self.age, self.name, sub))

    # 教师类，继承自学生类


class Teacher(Student):
    # 教方法
    def teach(self, sub):
        print("%d岁的%s正在教%s" % (self.age, self.name, sub))


if __name__ == "__main__":
    p = People("张三", 20)
    p.walk(3)
    stu = Student("李四", 25)
    stu.walk(5)
    stu.study('Python')
    tea = Teacher('王五', 30)
    tea.walk(4)
    tea.study("教育理论")
    tea.teach('Java')
